<!DOCTYPE html>
<html lang="en">
	<head>
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		<meta charset="utf-8" />
		<title>首页 - 驴妈妈流立方</title>
		<meta name="description" content="overview &amp; stats" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
		<script src="${rc.contextPath}/assets/js/jquery.2.1.1.min.js"></script>
		<script src="${rc.contextPath}/assets/js/bootstrap.min.js"></script>
		<script src="${rc.contextPath}/assets/js/jquery-ui.custom.min.js"></script>
		<script src="${rc.contextPath}/assets/js/jquery.ui.touch-punch.min.js"></script>
		<script src="${rc.contextPath}/assets/js/bootbox.min.js"></script>
		<script src="${rc.contextPath}/assets/js/jquery.gritter.min.js"></script>
		<script src="${rc.contextPath}/assets/js/spin.min.js"></script>
		<!-- ace scripts -->
		<script src="${rc.contextPath}/assets/js/ace-elements.min.js"></script>
		<script src="${rc.contextPath}/assets/js/ace.min.js"></script>
		<!-- validator scripts -->
		<script src="${rc.contextPath}/assets/js/bootstrapValidator.min.js"></script>
		<!-- user scripts -->
		<script src="${rc.contextPath}/assets/js/user/base.js"></script>
		<link rel="stylesheet" href="${rc.contextPath}/assets/css/bootstrap.min.css" />
		<link rel="stylesheet" href="${rc.contextPath}/assets/font-awesome/4.2.0/css/font-awesome.min.css" />
		<!-- page specific plugin styles -->
		<link rel="stylesheet" href="${rc.contextPath}/assets/css/jquery-ui.custom.min.css" />
		<link rel="stylesheet" href="${rc.contextPath}/assets/css/jquery.gritter.min.css" />
		<!-- text fonts -->
		<link rel="stylesheet" href="${rc.contextPath}/assets/fonts/fonts.googleapis.com.css" />
		<!-- BootstrapValidator -->
		<link rel="stylesheet" href="${rc.contextPath}/assets/css/bootstrapValidator.min.css" />
		<!-- ace styles -->
		<link rel="stylesheet" href="${rc.contextPath}/assets/css/ace.min.css" class="ace-main-stylesheet" id="main-ace-style" />
		<!-- ace settings handler -->
		<script src="${rc.contextPath}/assets/js/ace-extra.min.js"></script>
		<link rel="stylesheet" href="${rc.contextPath}/assets/css/bsie-paginator.css" />

	</head>

	<body class="no-skin" style="background-color: #FFF;">
		<div class="page-content">
		<div class="tab-content">
		<div class="row">
				<div class="col-xs-12">
				<!-- <div class="clearfix">
					<div class="pull-left tableTools-container">
					     <button class="btn btn-xs btn-primary" onclick="javascript :history.back(-1);"><i class="ace-icon fa fa-pencil-square-o align-top bigger-125"></i>返回</button>
					</div>
				</div> -->
					<div class="widget-box">
						<div class="widget-header widget-header-small">
						</div>
						<div class="widget-body" style="background-color: #EFF3F8;">
							<div class="widget-main">
								<form class="form-inline" id="searchForm" method="post" action="${rc.contextPath}/webStatistics/maintenance">
									<div class="form-group">
										<label for="exampleInputName2">规则名称</label>
										<input type="text" id="name" class="form-control" name="name" value="${H5RuleVO.name}" placeholder="请输入查询的规则名称" size=40>
									</div>
									<div class="form-group">
									  	<button id="search" type="button" onclick="searchClick();" class="btn btn-pink btn-sm">
											<span class="ace-icon fa fa-search icon-on-right bigger-110"></span>
											Search
										</button>
									</div>
									<div class="form-group">
									  	<button id="search" type="button" onclick="skip('${rc.contextPath}/webStatistics/firstScreenTimeCount')" class="btn btn-info btn-sm">
											<i class="ace-icon fa fa-undo bigger-110"></i>
						                                                     返回
										</button>
									</div>
								</form>
							</div>
						</div>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col-xs-12">
					<div class="widget-box">
					<form class="form-inline" id="searchForm" method="post" action="${rc.contextPath}/webStatistics/maintenance">
									<!-- <table id="simple-table" class="table table-striped table-bordered table-hover" style="margin-bottom: 0px;border-bottom: 0px;"> -->
								    <table id="dynamic-table" class="table table-striped table-bordered table-hover dataTable no-footer" role="grid" aria-describedby="dynamic-table_info">
										<thead>
											<tr>
												<th>序号</th>
												<th>规则名称</th>
												<th>规则配置URL</th>
												<th>查询条件</th>
												<th>操作</th>
											</tr>
										</thead>
										<tbody>
											<#if maintenanceList?? && maintenanceList?size&gt;0>
												<#list maintenanceList as rule>
													<tr class="">
														<td>${rule_index + 1}</td>
														<td>${rule.name}</td>
														<td>${rule.link_url!}</td>
													    <td>${rule.conditionName!}</td>
													    <td>
													      <a class="btn btn-xs btn-primary" href="${rc.contextPath}/webStatistics/ruleEdit?id=${rule.id!}&ruleId=${rule.ruleId}" role="button">编辑</a>
											              <a class="btn btn-xs btn-pink"  onclick="ruleDelete('${rule.id!}', '${rule.ruleId!}')">删除</a>
													    </td>
													</tr>
												</#list>
											<#else>
												<tr>
													<td colspan="12">
														<div class="alert alert-danger" style="margin-bottom: 0px;" role="alert">没有记录!</div>
													</td>
												</tr>
											</#if>
										</tbody>
									</table>
									<#include "paginator.html">\
						</form>
					</div>
				</div>
			</div>
		</div>
		</div>

		<script src="${rc.contextPath}/assets/js/moment.min.js"></script>
		<script src="${rc.contextPath}/assets/js/bootstrap-datetimepicker.min.js"></script>
		
		<link rel="stylesheet" href="${rc.contextPath}/stylesheets/daterangepicker.css">
		<script type="text/javascript" src="${rc.contextPath}/javascripts/jquery.2.1.1.min.js"></script>
	   	<script type="text/javascript" src="${rc.contextPath}/javascripts/bootstrap.min.js"></script>
	   	<script type="text/javascript" src="${rc.contextPath}/javascripts/moment.js"></script>
	   	<script type="text/javascript" src="${rc.contextPath}/javascripts/daterangepicker.js"></script>
	   	
	   	<script type="text/javascript" src="${rc.contextPath}/javascripts/echarts.js"></script>
	   	<script type="text/javascript" src="${rc.contextPath}/javascripts/china.js"></script>
	   	<script src="${rc.contextPath}/assets/js/jquery.gritter.min.js"></script>

		<link rel="stylesheet" href="${rc.contextPath}/assets/css/bootstrap.css" /> 
		<script src="${rc.contextPath}/assets/js/chosen.jquery.js"></script>
		
	    
	    <script type="text/javascript">
				function ruleDelete(id, ruleId) {
					 $.ajax({
		                 type:"GET",
		                 url:"${rc.contextPath}/webStatistics/ruleDelete?id=" + id + "&ruleId=" + ruleId,
		                 success:function(data){
		                	showMsg(data.msg);
		                	if (data.code == 1) {
		                		showMsg("删除成功！");
		                		location.reload();
		                	}
		                 }
		             });
				}
				
				
				
				function searchClick() {
					var name = $("#name").val();
					$("name").val(name);
					
					$("#searchForm").submit();
				}
	</script>
	    
	</body>
</html>